#ifndef __MCU_H__
#define __MCU_H__

#include "types.h"

#define MCU_SYSCLK  24500000     // SYSCLK frequency in Hz

typedef enum _MCU_SYSCLK_LEVEL_T_
{
    MCU_SYSCLK_LEVEL_MIN,
    MCU_SYSCLK_LEVEL_MIDDLE,
	MCU_SYSCLK_LEVEL_MAX
}MCU_SYSCLK_LEVEL_T;

void mcu_change_sysclock(MCU_SYSCLK_LEVEL_T clk);

void mcu_ports_init(void);

/**
 * interrupt configuration
 */
// enable/disable all interrupts
#define MCU_INTERRUPT_OFF    (EA = 0)
#define MCU_INTERRUPT_ON      (EA = 1)

#define MCU_INTERUPT_CNT   16

void mcu_interrupt_init(void);

void mcu_init(void);

/**
 * watchdog settings
 */
void mcu_watchdog_enable(UINT8 ms);
void mcu_watchdog_feed();
void mcu_watchdog_disable();

#endif
